Digital Garden of Paul

Comparing Event-Driven Architecture and Event Sourcing

On its surface Event Driven Architecture and Event sourcing have many overlapping functions and characteristics. However, essential differences exists which need to be taken into consideration. Mixing the two patterns without thoughtful consideration could lead to an architecture that has an high load of published and distributed events, and a lack of ownership and agility.

Comparison overview

As described by Pablo Iorio the following comparison can be made.

AspectsEvent sourcingEvent-Driven architecture
PurposeKeeping historyHighly adaptable and scalable
ScopeSingle application/systemWhole organisation/several apps
StorageCentral event storeDecentralised
TestingEasierHarder

Comparison

Purpose

Event sourcing is an alternative to traditional persistence strategies, with the purpose of keeping history. Event driven architecture is a distributed asynchronous architecture pattern used to produce highly scalable applications. In other words, event sourcing is about having historical records in an organisation, whereas EDAs are highly adaptable, scalable and can be used for small applications and as well as large, complex ones.

Scope

Event sourcing is usually applied in a single application/system, maybe implemented as services; however usually sharing the same storage. Meanwhile, EDAs are used across several apps/systems. Being a reliable integration pattern to achieve high levels of agility to respond quickly to a constantly changing environment.

Data storage

Event sourcing has a central event store, which usually has replicas, sharding, etc. It relies on a central database. By contrast, EDAs are distributed so each component (or event processors) is decoupled and most likely to have their own storage.

Testability

Event sourcing is easier to test in comparison, since it can replay the whole sequence of events from scratch to arrive to a certain state/situation. On the other hand, EDAs are easy to test for each component in isolation, however testing the whole is complicated by the asynchronous nature of this pattern.

Source: Pablo Iorio

Comparing Event-Driven Architecture and Event Sourcing